:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #172033;
    background: #f4f6fa;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: #f4f6fa;
    color: #172033;
}

a {
    color: #1957d2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 32px auto;
}

/* NAVBAR */

.navbar {
    min-height: 72px;
    padding: 14px 32px;
    background: #111827;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-link {
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

.nav-user {
    color: #cbd5e1;
}

/* INTESTAZIONE PAGINA */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    color: #111827;
}

.page-header p {
    margin: 0;
    color: #687386;
}

/* CARD */

.card,
.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.07);
}

.login-card {
    width: min(420px, 100%);
    margin: 80px auto;
}

.login-card h1 {
    margin-top: 0;
}

/* FORM */

label {
    display: block;
    margin-bottom: 16px;
    color: #172033;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 7px;
    padding: 12px 13px;

    font: inherit;
    color: #172033;
    background: #ffffff;

    border: 1px solid #d8deea;
    border-radius: 10px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #1957d2;
    box-shadow: 0 0 0 3px rgba(25, 87, 210, 0.12);
}

textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.full {
    grid-column: 1 / -1;
}

/* BOTTONI */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 10px;
    padding: 11px 16px;

    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.btn-primary {
    background: #1957d2;
    color: #ffffff;
}

.btn-secondary {
    background: #e8edf5;
    color: #172033;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
}

/* STATISTICHE */

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stats div {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

.stats strong {
    display: block;
    margin-bottom: 5px;
    font-size: 28px;
    color: #111827;
}

.stats span {
    color: #687386;
}

/* FILTRI */

.filters {
    display: grid;
    grid-template-columns: 1fr 220px auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.filters input,
.filters select {
    margin-top: 0;
}

/* TABELLA */

.table-wrap {
    overflow-x: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

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

th,
td {
    padding: 15px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody tr:hover {
    background: #f8fafc;
}

td small {
    display: block;
    margin-top: 4px;
    color: #687386;
}

/* BADGE */

.badge {
    display: inline-block;
    padding: 6px 10px;

    background: #e7efff;
    color: #194eb5;

    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ALERT */

.alert {
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 10px;
    font-weight: 600;
}

.alert-success {
    background: #ddf7e8;
    color: #166534;
}

.alert-warning {
    background: #fff2cc;
    color: #854d0e;
}

.alert-danger {
    background: #ffe0e0;
    color: #991b1b;
}

/* DETTAGLIO LEAD */

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.timeline-item {
    margin-bottom: 20px;
    padding-left: 14px;
    border-left: 3px solid #1957d2;
}

.timeline-item strong {
    display: block;
    margin-bottom: 4px;
}

.timeline-item span {
    color: #687386;
    font-size: 13px;
}

.timeline-item p {
    margin: 8px 0;
}

/* GESTIONE UTENTI */

.user-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.password-details {
    position: relative;
}

.password-details summary {
    list-style: none;
}

.password-details summary::-webkit-details-marker {
    display: none;
}

.password-form {
    position: absolute;
    right: 0;
    top: 48px;
    z-index: 10;

    width: 300px;
    padding: 18px;

    background: #ffffff;
    border: 1px solid #d8deea;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
}

.password-form label {
    margin-bottom: 12px;
}

/* MOBILE */

@media (max-width: 800px) {

    .navbar {
        padding: 16px;
        align-items: flex-start;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-user {
        display: none;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters,
    .two-columns,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

    .password-form {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 100px;
        width: auto;
    }
}