* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: #f4f7f6;
    color: #2c3e50;
    -webkit-tap-highlight-color: transparent;
}

/* Layout per le pagine dell'applicazione (con menu inferiore) */
body.app-layout {
    padding-bottom: 90px;
}

.container {
    padding: 15px;
    max-width: 600px;
    margin: auto;
}

/* Card universali */
.card {
    background: white;
    padding: 18px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

/* Form e Griglie */
.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.flex-50 {
    flex: 1;
    min-width: 0;
}

/* Input e Controlli */
input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: #27ae60;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Pulsanti */
button, .btn {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

button:hover, .btn:hover {
    background: #219653;
}

.btn-secondary { background: #3498db; }
.btn-secondary:hover { background: #2980b9; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }

/* Tabelle e liste movimenti */
table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 12px 5px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    vertical-align: middle;
}

.sub-text {
    color: #888;
    font-size: 0.75rem;
    display: block;
}

.metodo-text {
    font-size: 11px;
    color: #95a5a6;
}

/* Alert e Notifiche */
.alert-info, .msg {
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.msg.error, .alert-danger {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.msg.success, .alert-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.info-box {
    font-size: 0.85rem;
    color: #666;
    text-align: left;
    background: #fffde7;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f9e79f;
    margin-bottom: 15px;
}

/* Componenti della Dashboard */
.utile {
    font-size: 22px;
    font-weight: bold;
}
.badge-ric {
    font-size: 10px;
    color: #3498db;
}

/* Componenti per il Setup delle Categorie */
.group-header {
    background: #f8f9fa;
    cursor: pointer;
}
.group-header:hover {
    background: #f1f2f6;
}
.submenu {
    display: none;
    background: #fafafa;
}

/* Componenti Schermata di Login (index.php) */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 350px;
}
.login-card h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

/* Barra di navigazione inferiore (Bottom Nav) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    height: 70px;
    border-top: 1px solid #eee;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    text-decoration: none;
    color: #95a5a6;
    text-align: center;
    display: flex;
    flex-direction: column;   /* Allinea icona e testo in verticale */
    align-items: center;      /* Centra orizzontalmente */
    justify-content: center; /* Centra verticalmente */
    font-size: 11px;
    padding: 2px 0;
}

.nav-item.active {
    color: #27ae60;
    font-weight: bold;
}

.nav-icon {
    display: block;
    font-size: 20px;
    margin-bottom: 2px;
}

/* Utility colori veloci (Utili per Movimenti, Budget e Investimenti) */
.text-success { color: #27ae60 !important; } /* Verde per entrate / rendimenti positivi */
.text-danger { color: #e74c3c !important; }  /* Rosso per uscite / perdite */
.text-primary { color: #3498db !important; } /* Blu per elementi informativi o ricorrenti */
.text-muted { color: #95a5a6 !important; }    /* Grigio per sottotitoli o date */
.font-bold { font-weight: bold; }