/* Error banner — placed at top of layout, centered with max-width */
#error-banner {
    max-width: 1400px;
    margin: 0 auto 16px;
    border-radius: 8px;
}

/* IMPORT FONT */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* VARIABILI CSS (Basate sull'immagine) */
:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --primary: #1e293b; /* Blu scuro del grafico */
    --primary-hover: #334155;
    --accent: #e2e8f0; /* Grigio chiaro per bottoni inattivi */
    --accent-red: #f05252; /* Colore badge rosso */
    --accent-blue: #3f83f8; /* Colore badge blu */
    --border-radius-lg: 24px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --font-family: 'Inter', sans-serif;
}

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 20px;
    min-height: 100vh;
}

/* ANIMAZIONI */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* HEADER */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 30px;
}

.logo-nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}
.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: inline-block;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    margin-right: 20px;
    transition: color 0.2s;
}
nav a.active, nav a:hover {
    color: var(--text-main);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar {
    background-color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: 14px;
    width: 250px;
    box-shadow: var(--shadow);
    outline: none;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* GRID LAYOUT */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* FORMS & INPUTS */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-muted);
}

input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--accent);
    border-radius: var(--border-radius-md);
    background-color: #f8fafc;
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius-md);
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* TABLES */
.table-container {
    overflow-x: auto;
}

.table-container.scrollable {
    max-height: 280px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 12px 10px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--accent);
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #f1f5f9;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* MOCK GRAFICO (per mantenere il look dell'immagine) */
.chart-scroll-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 10px;
}
.mock-chart {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 180px;
    min-width: max-content;
    gap: 8px;
    padding: 0 4px;
}
.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.bar-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 28px;
    height: 130px;
}
.bar-segment {
    width: 100%;
    border-radius: 0;
}
.bar-segment:first-child {
    border-radius: 4px 4px 0 0;
}
.bar-segment:last-child {
    border-radius: 0 0 4px 4px;
}
.bar-segment:only-child {
    border-radius: 4px;
}
.bar-success { background-color: #22c55e; }
.bar-error   { background-color: #ef4444; }
.bar-running { background-color: #f59e0b; }

.wf-label {
    width: 60px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}
.day-label {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--accent);
    color: var(--text-muted);
}
.day-label.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* LOGIN */
#view-login {
    min-height: 100vh;
    background-color: var(--bg-color);
    padding: 20px;
    flex-direction: column;
}

#logoutBtn {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
}

/* FILTRO DATA ERRORI */
.filter-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.filter-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}
.filter-btn.active {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.filter-btn-blue:hover  { border-color: #3f83f8; color: #3f83f8; }
.filter-btn-blue.active { background: #3f83f8; border-color: #3f83f8; color: white; }
