<style>
:root {
    --primary:    #3498db;
    --secondary:  #2ecc71;
    --dark:       #2c3e50;
    --light-bg:   #f8f9fa;
    --gray:       #bdc3c7;
    --border:     #e0e0e0;
    --error:      #e74c3c;
    --success:    #27ae60;
}

.contratti-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.contratti-container h1 {
    color: var(--dark);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Form Styling */
.contratti-upload {
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.form-row {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-row:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.form-row label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #34495e;
}

select,
input[type="file"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--gray);
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.3s ease;
}

select:focus,
input[type="file"]:focus {
    border-color: var(--primary);
    outline: none;
}

/* Pulsanti */
.dual-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

input[type="submit"] {
    flex: 1;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="submit"][name="submit_contratti"] {
    background: var(--primary);
    color: #fff;
}

input[type="submit"][name="aggiorna_contratti"] {
    background: var(--secondary);
    color: #fff;
}

input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Messaggi */
.contratti-message {
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.contratti-message.success {
    background: #e8f6ef;
    border: 1px solid var(--secondary);
    color: var(--success);
}

.contratti-message.error {
    background: #fde8e8;
    border: 1px solid var(--error);
    color: #c0392b;
}

/* Tabella Documenti */
.contratti-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}

.contratti-table th,
.contratti-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.contratti-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.contratti-table tr:hover td {
    background: var(--light-bg);
}

/* Pulsante Download */
.download-link {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    transition: background 0.2s ease;
    margin-right: 0.5rem;
}

.download-link:hover {
    background: #e8f6ef;
    text-decoration: underline;
}

/* Pulsante Elimina */
.delete-link {
    color: var(--error) !important;
    font-weight: 600;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.delete-link:hover {
    background: #fde8e8;
    text-decoration: underline;
}
</style>