/* --- 1. VARIABILI COLORI & BASE --- */
:root {
    --primary: #2271b1;       /* Blu WordPress */
    --primary-dark: #135e96;  /* Blu scuro al click */
    --bg: #f0f0f1;            /* Grigio sfondo chiaro */
    --text: #1d2327;          /* Nero testo */
    --white: #ffffff;
    --gray: #646970;
    --border: #dcdcde;
    --success: #00a32a;       /* Verde Conferma */
    --danger: #d63638;        /* Rosso Errore/Esci */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    /* Evita il flash blu quando tocchi un link su Android */
    -webkit-tap-highlight-color: transparent; 
}

/* --- 2. LAYOUT GENERALE --- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    padding: 20px;
    /* Lasciamo spazio in basso per la barra di navigazione fissa */
    padding-bottom: 90px; 
    max-width: 600px; /* Su PC non diventa larghissimo */
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* --- 3. BARRA DI NAVIGAZIONE IN BASSO (Footer Fisso) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around; /* Spazia le icone equamente */
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--gray);
    font-size: 10px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    flex: 1; /* Occupa tutto lo spazio disponibile */
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: bold;
}

/* --- 4. HEADER SUPERIORE --- */
.app-header {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; /* Rimane attaccato in alto se scorri */
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-title { font-size: 18px; font-weight: bold; margin: 0; }

/* --- 5. COMPONENTI UI (Card, Bottoni) --- */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.02);
}

.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    background: var(--primary);
    color: var(--white);
    transition: background 0.2s;
}
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); }
.btn:disabled { background: #a7aaad; cursor: not-allowed; }

/* Input grandi per dita grosse */
input, select {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px; /* 16px evita lo zoom automatico su iPhone */
    box-sizing: border-box;
    background: #fff;
}

/* --- 6. UTILITY --- */
.hidden { display: none; }
.text-center { text-align: center; }

/* Badge colorati (es. "Online", "Offline") */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}
.badge-green { background: #d1e7dd; color: #0f5132; }
.badge-red { background: #f8d7da; color: #842029; }