/* Reset base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Stili globali */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    font-size: 16px;
    color: #495057;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    color: #5786b7;
    text-align: center; /* Centra tutti i titoli */
}

a {
    color: #5786b7;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.header {
    background-color: #5786b7;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header a {
    color: white;
    margin-left: 1rem;
    font-weight: 600;
    color: #ffef68;
}

.header a:hover {
    text-decoration: underline;
}

/* Container principale */
.container {
    display: flex;
    flex: 1;
    margin: 0;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #f9f9f9;
    padding: 1rem;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
}

.sidebar ul li a {
    text-decoration: none;
    color: #5786b7;
    font-weight: bold;
}

.sidebar ul li a:hover {
    color: #0056b3;
}

.sidebar ul li.active a {
    color: #fff;
    background-color: #5786b7;
}

.sidebar ul li a {
  display: block;
  padding: 8px 16px;
}

.sidebar ul li a:hover {
  background-color: #5786b7;
  color: white;
}

/* Contenuto principale */
.main-content {
    flex: 1;
    padding: 2rem;
    background-color: #fff;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #f9f9f9;
    padding: 1rem;
}

/* Tabelle */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: center; /* Centra tutto di default */
}

table th {
    background-color: #5786b7;
    color: white;
    text-align: center; /* Centra tutti i titoli nel thead */
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.align-left {
    text-align: left;
}

.align-right {
    text-align: right;
}

/* Totali */
.totali {
    margin-top: 1rem;
    text-align: right;
}

.totali span {
    font-weight: bold;
}

/* Pulsanti */
button,
input[type="submit"],
input[type="button"] {
    padding: 0.8rem 1.5rem;
    background-color: #5786b7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background-color: #0056b3;
}

/* Profilo utente */
.profile-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 1rem;
}

.profile-field {
    margin-bottom: 1rem;
}

.profile-field label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
    color: #5786b7;
}

.profile-field span {
    display: block;
    padding: 0.5rem;
    background-color: #f0f8ff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.profile-section h2 {
    margin-bottom: 1rem;
}

.profile-field {
    margin-bottom: 1rem;
    width: auto;
}

.profile-field label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
    color: #5786b7;
}

.profile-field span {
    display: block;
    padding: 0.5rem;
    background-color: #f0f8ff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
/* Azioni */
.actions {
    margin-top: 1rem;
    text-align: center;
}

.actions button {
    margin: 0.5rem;
}

/* Dettagli bonifico */
.bonifico-details {
    margin-top: 1rem;
    text-align: center;
    display: none; /* Nascondi inizialmente */
}

.bonifico-details strong {
    color: #5786b7;
}

/* Messaggi di stato */
.status-message {
    margin-top: 1rem;
    text-align: center;
}

.status-message p {
    padding: 1rem;
    border-radius: 5px;
}

.status-message .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Support Form */
.support-form {
    width: 600px;
    margin: 0 auto;
}

.profile-box .form-group,
.support-form .form-group,
.filter-form .form-group {
    margin-bottom: 1rem;
}

#form_privato,
#form_azienda {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#form_privato .form-group,
#form_azienda .form-group {
    flex-basis: calc(50% - 10px); /* Each field takes up roughly half the width, accounting for gap */
    margin-bottom: 0; /* Remove bottom margin as gap provides spacing */
}

.profile-box label,
.support-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.profile-box .form-control,
.support-form .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-form .form-control {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.support-form .btn-primary {
    background-color: #5786b7;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.support-form .btn-primary:hover {
    background-color: #0056b3;
}

.success-message {
    color: green;
    margin-top: 1rem;
}

/* Support Container */
.support-container {
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.support-container p {
    text-align: center;
    margin: 10px 0;
}

/* Footer */
.footer {
    background-color: #5786b7;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* Profile Box Styles */
.profile-box {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to the next line */
    gap: 20px; /* Adds space between flex items */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    max-width: 800px; /* Set a max width for the box */
    margin: 20px auto; /* Center the box horizontally */
    justify-content: space-between; /* Distribute items with space between */
    text-align: center; /* Center text within the box */
}

.profile-field {
    flex-basis: calc(50% - 10px); /* Each field takes up roughly half the width, accounting for gap */
    margin-bottom: 0; /* Remove bottom margin as gap provides spacing */
    text-align: left; /* Align text left within fields */
}

/* Stili per le label degli upload in registrazione_pec.php */
label[for="documento1"],
label[for="documento2"] {
    font-size: 14px;
    line-height: 1.4;
    font-weight: normal;
}

/* Stili per i pulsanti di upload in registrazione_pec.php */
input[type="file"].form-control {
    /* Styling file inputs directly is limited and inconsistent.
       This will style the text field part if visible, not the button.
       A more robust solution would involve custom styling with labels. */
    background-color: #5786b7; /* Example background color */
    color: white; /* Example text color */
    /* Additional styling might be needed depending on browser default rendering */
}

/* Ensure the submit button also has the desired appearance */
.support-form button[type="submit"] {
    background-color: #5786b7;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.support-form button[type="submit"]:hover {
    background-color: #0056b3;
}

.profile-field label {
    margin-bottom: 5px; /* Adjust label margin */
}
