/* ── NAVBAR ────────────────────────────────────── */
.navbar {
    display: flex; align-items: center;
    background: var(--primary); border-bottom: 1px solid var(--border);
    padding: 0 20px; height: 54px; position: sticky; top: 0; z-index: 1000;
}
.navbar-brand {
    font-weight: 800; font-size: 1em; color: var(--text);
    margin-right: 30px; white-space: nowrap;
}
.navbar-links { display: flex; gap: 2px; flex: 1; }
.nav-link {
    padding: 6px 14px; border-radius: var(--radius-md);
    color: var(--text-muted); font-size: 0.84em; font-weight: 600;
    cursor: pointer; transition: all var(--transition); border: none; background: none;
    white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--secondary); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.navbar-logout {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.1em; cursor: pointer; padding: 6px 10px;
    border-radius: var(--radius-sm); transition: all var(--transition);
    margin-left: auto;
}
.navbar-logout:hover { color: var(--danger); background: var(--danger-dim); }

/* ── MAIN ──────────────────────────────────────── */
.main-content {
    max-width: 1400px; margin: 0 auto;
    padding: 20px;
}

/* ── DASHBOARD ─────────────────────────────────── */
.dashboard {
    margin-bottom: 18px;
}

/* ── TX TABLE (storico) — no scroll orizzontale ── */
.tx-table { width: 100%; border-collapse: collapse; font-size: 0.78em; }
.tx-table th { font-size: 0.66em; padding: 6px 5px; white-space: nowrap; }
.tx-table td { padding: 8px 5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table td:last-child { white-space: nowrap; min-width: 64px; }
.modal-wide { max-width: 900px !important; }
.modal-wide .table-wrapper { overflow-x: auto; }

/* ── RESPONSIVE MOBILE ─────────────────────────── */
/* ── SHOW/HIDE DESKTOP vs MOBILE ───────────────── */
.desktop-only { display: block; }
.mobile-only  { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only  { display: block; }

    .main-content { padding: 10px; }
    .navbar { padding: 0 10px; }
    .navbar-brand { margin-right: 10px; font-size: 0.88em; }

    body.modal-open { overflow: hidden; }

    /* KPI compatti: scroll orizzontale */
    .kpi-group { padding: 12px 14px; overflow-x: auto; }
    .kpi-row   { flex-wrap: nowrap; min-width: max-content; }
    .kpi-item  { min-width: 120px; }

    /* Card padding ridotto */
    .card { padding: 12px; }

    /* Modali dal basso */
    .overlay { align-items: flex-end; }
    .modal {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        width: 100%; max-width: 100%;
        max-height: 90vh;
    }
    .modal.modal-wide { max-width: 100%; }

    /* Form colonna singola */
    .form-row { flex-direction: column; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }

    /* Controls bar impilata */
    .controls-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .controls-right { flex-wrap: wrap; }

    /* tabella storico compatta su mobile */
    .tx-table-compact th,
    .tx-table-compact td { padding: 6px 5px; font-size: 0.78em; }

}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .navbar-brand { display: none; }
    .nav-link { padding: 5px 10px; font-size: 0.82em; }
    .kpi-value { font-size: 1em; }
}


@media (max-width: 480px) {
    body { font-size: 15px; }
    .navbar-brand { display: none; }
    .nav-link { padding: 5px 10px; font-size: 0.82em; }
    table { min-width: 600px; }
    .kpi-value { font-size: 1em; }
}

/* ── RESPONSIVE VISIBILITY: desktop table / mobile cards ───────────── */

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}





