/* =========================================================
   TEMA VERDE AZIENDALE - UI COMPLETA
   Dashboard, Diagnostica, Tabelle, Layout Globale
   Versione definitiva
   ========================================================= */


/* =========================================================
   BASE - LAYOUT GENERALE
   ========================================================= */

body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f7f1;
    color: #333;
}

h1, h2, h3, h4, h5 {
    color: #14532d;
    margin-top: 0;
}

/* HEADER */
.header {
    background: #14532d;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h2 {
    margin: 0;
    font-weight: 600;
}

.header .user-info a {
    color: #bbf7d0;
    text-decoration: none;
    font-weight: 500;
}

.header .user-info a:hover {
    color: white;
}

/* NAVBAR */
nav {
    background: #0f3d23 !important;
    padding: 12px 20px !important;
    font-size: 0.9rem;
}

nav a {
    color: #ffffff !important;
    margin-right: 15px;
    text-decoration: none;
    font-weight: 600;
}
/* Voci dei sottomenu (tendine bianche): testo scuro leggibile, batte l'!important sopra */
.dropdown-content a {
    color: #1a1a2e !important;
}
.dropdown-content a:hover {
    color: #000000 !important;
    background-color: #f0f2f5 !important;
}

nav a:hover {
    color: white !important;
}

/* CONTENUTO */
.content {
    padding: 25px;
    max-width: 1300px;
    margin: auto;
}

/* BOX GENERICI */
.box {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* INPUT BASE */
input[type=text],
input[type=number],
select,
textarea {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

/* BUTTON */
button {
    background: #16a34a;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #15803d;
}



/* =========================================================
   DASHBOARD CARDS
   ========================================================= */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #065f46;
}

.stat-label {
    font-size: 0.95rem;
    color: #374151;
}


/* COLORI */
.stat-box--money { background: #ecfdf5; border-left: 5px solid #10b981; }
.stat-box--refurb { background: #eef2ff; border-left: 5px solid #6366f1; }
.stat-box--sold   { background: #fef2f2; border-left: 5px solid #ef4444; }
.stat-box--avg    { background: #f0fdf4; border-left: 5px solid #22c55e; }



/* =========================================================
   TABELLE PROFESSIONALI
   ========================================================= */

.styled-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
}

.styled-table thead th {
    background: #14532d;
    color: white;
    padding: 12px;
    font-weight: 600;
}

.styled-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.styled-table tbody tr:nth-child(even) {
    background: #f3faf4;
}

.styled-table tbody tr:hover {
    background: #dcfce7 !important;
}

.styled-table td {
    padding: 10px 12px;
}



/* =========================================================
   DIAGNOSTICA
   ========================================================= */

.diag-wrapper {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* HEADERS COLLASSABILI */
.diag-header {
    background: #14532d;
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.diag-header h4 {
    margin: 0;
    color: white;
}

.toggle-icon {
    font-size: 1.4rem;
    transition: 0.3s;
}

.diag-content {
    padding: 20px;
    transition: all 0.3s ease;
}

.diag-content.closed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

/* GRIGLIA STATISTICHE */
.diag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.diag-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.diag-card.total {
    background: #dcfce7;
    border-color: #86efac;
}

.diag-card .lbl { font-size: 0.85rem; color: #555; }
.diag-card .val {
    font-size: 1.7rem;
    font-weight: bold;
    color: #065f46;
}

/* Box tabella */
.diag-table {
    background: white;
    margin-top: 10px;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Pulsante correggi */
.fix-btn {
    background: #1d4ed8;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
}

.fix-btn:hover {
    background: #1e3a8a;
}
