/* RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #f5f5f5;
}

/* BOTTONI */
.btn {
    padding: 8px 14px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.8;
}

.btn-green { background: #28a745; }
.btn-orange { background: #ff9800; }
.btn-danger { background: #d9534f; }

/* BARRA SUPERIORE */
.top-bar {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

input[type=text],
input[type=date],
input[type=email],
input[type=number],
textarea,
select {
    padding: 8px;
    font-size: 16px;
    width: 100%;
}

/* TABELLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    word-wrap: break-word;
}

th {
    background: #f2f2f2;
}

/* ========================= */
/* RESPONSIVE SMARTPHONE     */
/* ========================= */

@media (max-width: 600px) {

    body {
        margin: 10px;
    }

    h2, h3 {
        font-size: 20px;
        text-align: center;
    }

    /* Bottoni in colonna */
    .btn {
        width: 100%;
        text-align: center;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar form {
        flex-direction: column;
        width: 100%;
    }

    /* Tabelle → card */
    table, tr, td, th {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        padding: 10px;
        background: #fff;
    }

    th {
        display: none;
    }

    td {
        border: none;
        padding: 6px 0;
    }

    td::before {
        font-weight: bold;
        display: block;
        margin-bottom: 3px;
        color: #444;
        content: attr(data-label);
    }
}