﻿* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

:root {
    --bg: #edf3fb;
    --text: #0f172a;
    --muted: #64748b;
    --line: #d9e2ec;
    --panel: #ffffff;
    --shadow-soft: 0 18px 44px rgba(15, 23, 42, 0.10);
    --shadow-strong: 0 26px 60px rgba(15, 23, 42, 0.14);
    --blue-1: #2563eb;
    --blue-2: #1d4ed8;
    --green-1: #10b981;
    --green-2: #059669;
    --violet-1: #8b5cf6;
    --violet-2: #7c3aed;
    --amber-1: #f59e0b;
    --amber-2: #d97706;
    --slate-1: #0f172a;
    --slate-2: #1e293b;
    --rose-1: #ef4444;
    --rose-2: #dc2626;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

form {
    margin: 0;
}

a {
    color: var(--blue-1);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1;
    letter-spacing: -0.05em;
}

h2 {
    margin-bottom: 8px;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

p {
    line-height: 1.6;
}

.muted,
.section-title p,
.app-header p,
.login-card p,
.login-visual p {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--blue-1);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.login-body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 34%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 28%),
        linear-gradient(135deg, #eef3f8 0%, #f8fafc 50%, #dde7f3 100%);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.login-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    overflow: hidden;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: var(--shadow-strong);
}

.login-visual {
    position: relative;
    min-height: 560px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(155deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.88));
    color: #ffffff;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: auto -90px -90px auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
}

.brand-block {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.brand-logo {
    max-width: 195px;
    width: 48%;
    margin-bottom: 28px;
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    padding: 10px;
}

.brand-image {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.15);
    opacity: 0.95;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
}

.login-visual .eyebrow,
.header-brand .eyebrow,
.brand-row .eyebrow {
    color: #93c5fd;
}

.login-visual p {
    color: #dbeafe;
    font-size: 17px;
}

.login-card {
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241, 245, 249, 0.98));
}

.login-panel {
    padding: 28px;
    border: 1px solid #dde7f0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 22px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label,
.selected-date span,
.summary-card-title,
.legend-title {
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.input-modern,
.select-modern {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #d5dfeb;
    border-radius: 14px;
    background: #fbfdff;
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.input-modern:focus,
.select-modern:focus {
    border-color: var(--blue-1);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.btn-primary,
.btn-secondary {
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
    width: 100%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--slate-1), #334155);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.message-line {
    display: block;
    min-height: 24px;
    margin-top: 10px;
    font-weight: 700;
}

.app-body {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at left center, rgba(139, 92, 246, 0.10), transparent 24%),
        linear-gradient(180deg, #eff4fb 0%, #eaf1f9 100%);
}

.app-page {
    min-height: 100vh;
}

.app-shell {
    width: min(1460px, 100%);
    margin: 0 auto;
    padding: 26px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 22px;
    border-radius: 28px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a, #1e40af);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-logo {
    width: 170px;
    max-height: 78px;
    object-fit: contain;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 9px 12px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.header-logo-login {
    max-height: 82px;
}

.app-header h1 {
    margin-bottom: 8px;
    font-size: clamp(28px, 4vw, 44px);
}

.app-header p {
    margin-bottom: 0;
    color: #dbeafe;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255,255,255,0.16);
    color: #ffffff !important;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.summary-card {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(217, 226, 236, 0.95);
    box-shadow: var(--shadow-soft);
}

.summary-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    color: var(--text);
}

.summary-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.summary-card.summary-blue::before { background: linear-gradient(180deg, var(--blue-1), #60a5fa); }
.summary-card.summary-green::before { background: linear-gradient(180deg, var(--green-1), #34d399); }
.summary-card.summary-violet::before { background: linear-gradient(180deg, var(--violet-1), #a78bfa); }

.controls-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1.18fr);
    gap: 22px;
    margin-bottom: 22px;
}

.card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(217, 226, 236, 0.95);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 7px;
}

.filter-card::before {
    background: linear-gradient(90deg, var(--green-1), #34d399);
}

.calendar-card::before {
    background: linear-gradient(90deg, var(--violet-1), #a78bfa);
}

.data-card::before {
    background: linear-gradient(90deg, var(--blue-1), #60a5fa);
}

.totals-card::before {
    background: linear-gradient(90deg, var(--amber-1), #fbbf24);
}

.filter-card,
.calendar-card,
.data-card,
.totals-card {
    padding: 24px;
}

.filter-card {
    background: linear-gradient(180deg, #ffffff 0%, #f1fbf7 100%);
}

.calendar-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f4ff 100%);
}

.data-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.totals-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff9eb 100%);
}

.section-title {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8edf4;
}

.section-title h2 {
    margin-bottom: 5px;
    font-size: 22px;
}

.section-title p {
    margin-bottom: 0;
    font-size: 14px;
}

.selected-date {
    margin: 18px 0;
    padding: 15px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.86);
    border: 1px solid #dfe8ee;
    border-left: 5px solid var(--green-1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.date-label {
    display: block;
    margin-top: 6px;
    color: var(--text) !important;
    font-weight: 700;
    font-size: 16px;
}

.check-modern {
    display: block;
    margin: 16px 0 20px;
    padding: 12px 14px;
    color: #334155;
    font-weight: 700;
    border-radius: 14px;
    border: 1px dashed #cbd5e1;
    background: rgba(255,255,255,0.75);
}

.check-modern input {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.calendar-scroll {
    overflow-x: auto;
}

.calendar-modern {
    min-width: 300px;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #e4defc;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.08);
}

.calendar-modern td,
.calendar-modern th {
    padding: 9px 10px !important;
    border-color: #e7e0fb !important;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-modern {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
    font-size: 14px;
    border: 1px solid #dbe5ef;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.table-modern th {
    padding: 13px 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--slate-1), #22304a);
    text-align: right;
    white-space: nowrap;
}

.table-modern th:first-child {
    text-align: left;
}

.table-modern td {
    padding: 12px;
    border-bottom: 1px solid #e7edf4;
    white-space: nowrap;
    text-align: right;
}

.table-modern td:first-child {
    text-align: left;
}

.table-modern td.numeric,
.table-modern th.numeric {
    text-align: right;
}

.table-modern tr:last-child td {
    border-bottom: 0;
}

.table-modern input,
.table-modern a {
    font-weight: 700;
}

.previous-block {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #dfe6ee;
}

.previous-title {
    display: block;
    margin-bottom: 14px;
    font-size: 20px;
    color: var(--text);
}

.totals-card {
    position: sticky;
    top: 22px;
}

.totals-top {
    position: static;
    margin-bottom: 22px;
}

.totals-top .totals-list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.totals-top .totals-legend {
    max-width: 720px;
}

.totals-card h2 {
    margin-bottom: 18px;
    font-size: 24px;
}

.totals-legend {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.78);
    border: 1px solid #f5ddb0;
    color: #7c5a10;
    font-size: 13px;
}

.totals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.total-item {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #efe3bf;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.total-item.total-highlight {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(254,243,199,0.72));
}

.total-item.total-danger {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(254,226,226,0.72));
    border-color: #fecaca;
}

.total-label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 13px;
}

.total-formula {
    display: block;
    margin-top: -4px;
    margin-bottom: 8px;
    color: #8a6a13;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.total-value {
    display: block;
    color: var(--text);
    font-size: 28px;
    line-height: 1.1;
    text-align: right;
}

.total-negative .total-value,
.total-negative .total-label {
    color: var(--rose-2) !important;
}

.total-note {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.3;
    text-align: right;
    color: #64748b;
}

.total-note-year {
    color: #475569;
    font-weight: 700;
}

.total-note-diff {
    color: #0f172a;
    font-weight: 800;
}

.message-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    color: #e2e8f0;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.10);
}

@media (max-width: 1100px) {
    .charts-grid,
    .dashboard-strip {
        grid-template-columns: 1fr;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .totals-card {
        position: static;
    }

    .totals-list,
    .totals-top .totals-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: auto;
        padding: 30px;
    }

    .brand-image {
        display: none;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-logo {
        width: 180px;
    }
}

@media (max-width: 620px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .login-page,
    .app-shell {
        padding: 14px;
    }

    .login-shell,
    .card,
    .app-header,
    .summary-card {
        border-radius: 20px;
    }

    .login-card,
    .login-visual,
    .login-panel,
    .filter-card,
    .calendar-card,
    .data-card,
    .totals-card,
    .app-header {
        padding: 18px;
    }

    .brand-logo {
        width: 150px;
    }

    .totals-list,
    .totals-top .totals-list {
        grid-template-columns: 1fr;
    }

    .table-modern {
        min-width: 680px;
        font-size: 13px;
    }

    .table-modern th,
    .table-modern td {
        padding: 10px;
    }

    .total-value {
        font-size: 22px;
    }
}


.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 22px;
}

.chart-card {
    padding: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.chart-card::before {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.chart-card-capi::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.chart-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.chart-row {
    padding: 12px;
    border: 1px solid #dfe7f1;
    border-radius: 16px;
    background: rgba(255,255,255,0.82);
}

.chart-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
}

.chart-row-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.chart-row-head strong {
    color: #0f172a;
    white-space: nowrap;
}

.chart-bar {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef6;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.chart-card-capi .chart-bar-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.chart-empty {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background: rgba(255,255,255,0.75);
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}


/* STEP 7 - Correzione grafici e compatibilita layout */
.app-header,
.totals-top,
.charts-grid,
.dashboard-strip,
.controls-grid,
.main-grid {
    clear: both;
    width: 100%;
}

.totals-top {
    display: block;
    overflow: visible;
}

.totals-top:after,
.charts-grid:after,
.dashboard-strip:after,
.controls-grid:after,
.main-grid:after,
.card:after {
    content: "";
    display: table;
    clear: both;
}

.charts-grid {
    display: block;
    margin: 0 0 22px 0;
}

.chart-card {
    display: block;
    width: 100%;
    margin: 0 0 22px 0;
    overflow: hidden;
}

@media (min-width: 1000px) {
    .charts-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .chart-card {
        margin-bottom: 0;
    }
}

.chart-safe {
    display: block;
    width: 100%;
    clear: both;
    overflow: hidden;
}

.chart-safe-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: fixed;
}

.chart-safe-row {
    background: #ffffff;
}

.chart-safe-name {
    width: 30%;
    max-width: 180px;
    padding: 8px 10px;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border: 1px solid #dfe7f1;
    border-right: 0;
    background: rgba(255,255,255,0.92);
}

.chart-safe-bar-cell {
    width: 50%;
    padding: 8px 8px;
    border-top: 1px solid #dfe7f1;
    border-bottom: 1px solid #dfe7f1;
    background: rgba(255,255,255,0.92);
}

.chart-safe-value {
    width: 20%;
    padding: 8px 10px;
    color: #0f172a;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border: 1px solid #dfe7f1;
    border-left: 0;
    background: rgba(255,255,255,0.92);
}

.chart-safe-track {
    display: block;
    width: 100%;
    height: 13px;
    border-radius: 999px;
    overflow: hidden;
    background: #e8eef6;
}

.chart-safe-fill {
    display: block;
    height: 13px;
    min-width: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.chart-card-capi .chart-safe-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

@media (max-width: 620px) {
    .chart-safe-table,
    .chart-safe-table tbody,
    .chart-safe-row,
    .chart-safe-name,
    .chart-safe-bar-cell,
    .chart-safe-value {
        display: block;
        width: 100%;
    }

    .chart-safe-row {
        margin-bottom: 12px;
        padding: 10px;
        border: 1px solid #dfe7f1;
        border-radius: 14px;
        background: rgba(255,255,255,0.92);
    }

    .chart-safe-name,
    .chart-safe-bar-cell {
        border: 0;
        padding: 3px 0;
        background: transparent;
        text-align: left;
    }

    .chart-safe-value {
        border: 0;
        padding: 3px 0;
        background: transparent;
        text-align: right;
    }

    .chart-safe-value {
        margin-top: 4px;
        font-size: 14px;
    }
}


/* STEP 8 - Cruscotti swipe per smartphone */
.mobile-dashboard-nav,
.mobile-dashboard-dots {
    display: none;
}

.mobile-dashboard {
    display: block;
    width: 100%;
}

.mobile-slide {
    display: block;
    width: 100%;
    margin-bottom: 0;
}

@media (max-width: 860px) {
    body.app-body {
        overflow-x: hidden;
    }

    .mobile-dashboard-nav {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        gap: 8px;
        margin: -6px 0 14px 0;
        padding: 8px;
        overflow-x: auto;
        border: 1px solid rgba(217, 226, 236, 0.95);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
        -webkit-overflow-scrolling: touch;
    }

    .mobile-dashboard-nav::-webkit-scrollbar,
    .mobile-dashboard::-webkit-scrollbar {
        display: none;
    }

    .mobile-tab {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 9px 14px;
        border: 1px solid #d7e1ec;
        border-radius: 999px;
        background: #ffffff;
        color: #334155;
        font-family: Tahoma, Arial, Helvetica, sans-serif;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
    }

    .mobile-tab.is-active {
        color: #ffffff;
        border-color: #1d4ed8;
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
    }

    .mobile-dashboard {
        display: flex;
        gap: 0;
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-dashboard > .mobile-slide {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        margin: 0;
        padding: 0 1px 12px 1px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        clear: none;
    }

    .mobile-dashboard > .mobile-slide.main-grid {
        display: block;
        grid-template-columns: none;
    }

    .mobile-dashboard .totals-top,
    .mobile-dashboard .charts-grid,
    .mobile-dashboard .dashboard-strip,
    .mobile-dashboard .controls-grid,
    .mobile-dashboard .main-grid {
        margin-bottom: 0;
    }

    .mobile-dashboard .totals-top .totals-list {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mobile-dashboard .charts-grid,
    .mobile-dashboard .dashboard-strip,
    .mobile-dashboard .controls-grid {
        display: block;
    }

    .mobile-dashboard .chart-card,
    .mobile-dashboard .summary-card,
    .mobile-dashboard .filter-card {
        margin-bottom: 16px;
    }

    .mobile-dashboard .calendar-card,
    .mobile-dashboard .chart-card:last-child,
    .mobile-dashboard .summary-card:last-child {
        margin-bottom: 0;
    }

    .mobile-dashboard .card {
        border-radius: 20px;
    }

    .mobile-dashboard .data-card {
        min-height: 60vh;
    }

    .mobile-dashboard .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-dashboard-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin: 4px 0 0 0;
        padding-bottom: 8px;
    }

    .mobile-dot {
        display: block;
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #cbd5e1;
        transition: width 0.18s ease, background 0.18s ease;
    }

    .mobile-dot.is-active {
        width: 24px;
        background: #2563eb;
    }
}

/* STEP 9 - Nuovo ordine cruscotti e grafici andamento PV */
.chart-card-trend::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.chart-card-trend-6::before {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.chart-card-trend-12::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.chart-card-trend .chart-safe-fill {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.chart-card-trend-6 .chart-safe-fill {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.chart-card-trend-12 .chart-safe-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.chart-card-trend {
    min-height: 100%;
}

@media (max-width: 860px) {
    .mobile-dashboard .chart-card-trend {
        margin-bottom: 0;
    }
}


/* Step 10 calendar title fix */
.calendar-modern tr:first-child td,
.calendar-modern tr:first-child th {
    background: #6d28d9 !important;
    color: #ffffff !important;
}

.calendar-modern tr:first-child a,
.calendar-modern tr:first-child span {
    color: #ffffff !important;
}

.calendar-modern title,
.calendar-modern caption {
    color: #ffffff !important;
}

/* STEP 11 - Filtri globali sempre visibili e calendario a comparsa */
.global-filter-bar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(240px, 1fr) 160px;
    gap: 14px;
    align-items: end;
    margin: -8px 0 18px 0;
    padding: 16px;
    border: 1px solid rgba(217, 226, 236, 0.95);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(12px);
}

.global-filter-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.global-filter-group label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.global-select {
    min-height: 48px;
}

.date-picker-toggle {
    width: 100%;
    min-height: 48px;
    padding: 11px 42px 11px 14px;
    border: 1px solid #d5dfeb;
    border-radius: 14px;
    background: #fbfdff;
    color: #0f172a;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.date-picker-toggle::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #2563eb;
    font-size: 16px;
    font-weight: 900;
}

.date-picker-toggle.is-open {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
    background: #ffffff;
}

.date-label-global {
    display: block;
    margin-top: 0;
    color: #0f172a !important;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.calendar-popover {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    width: min(360px, 92vw);
    padding: 14px;
    border: 1px solid #d9e2ec;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.20);
    z-index: 50;
}

.calendar-popover.is-open {
    display: block;
}

.calendar-popover-title {
    margin-bottom: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.btn-refresh-global {
    min-height: 48px;
    width: 100%;
}

.incassi-options {
    margin: -4px 0 16px 0;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background: rgba(255, 255, 255, 0.78);
}

.incassi-options .check-modern {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

@media (max-width: 1100px) {
    .global-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .global-filter-refresh {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .global-filter-bar {
        grid-template-columns: 1fr;
        gap: 11px;
        margin: -2px 0 12px 0;
        padding: 12px;
        border-radius: 20px;
    }

    .calendar-popover {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 126px;
        width: auto;
        max-height: calc(100vh - 150px);
        overflow: auto;
    }

    .mobile-dashboard-nav {
        position: relative;
        top: auto;
        z-index: 20;
        margin-top: 0;
    }
}


/* STEP 12 - Correzione mobile: i filtri non devono coprire i cruscotti */
@media (max-width: 860px) {
    .global-filter-bar {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        margin: 0 0 16px 0 !important;
        padding: 12px !important;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
        backdrop-filter: none;
    }

    .global-filter-group label {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .global-select,
    .date-picker-toggle,
    .btn-refresh-global {
        min-height: 44px;
    }

    .mobile-dashboard-nav {
        position: sticky;
        top: 0;
        z-index: 24;
        margin: 0 0 14px 0;
    }

    .mobile-dashboard {
        position: relative;
        z-index: 1;
    }

    .mobile-dashboard > .mobile-slide {
        padding-top: 0;
    }

    .calendar-popover {
        position: absolute !important;
        left: 0 !important;
        right: auto !important;
        top: calc(100% + 8px) !important;
        width: min(360px, 100%) !important;
        max-height: 72vh;
        overflow: auto;
        z-index: 60;
    }
}


/* STEP 13 - Andamento incassi complessivi 12 mesi */
.chart-card-total-12::before {
    background: linear-gradient(90deg, #2563eb, #22c55e);
}

.chart-card-total-12 .chart-safe-fill {
    background: linear-gradient(90deg, #2563eb, #22c55e);
}

.chart-card-total-12 {
    min-height: 100%;
}

@media (max-width: 860px) {
    .mobile-dashboard .chart-card-total-12 {
        margin-bottom: 0;
    }
}


/* STEP 14 - Analisi vendite da query Grafico */
.chart-card-products::before {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
}

.chart-card-products .chart-safe-fill {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
}

.chart-card-products-bottom::before {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.chart-card-products-bottom .chart-safe-fill {
    background: linear-gradient(90deg, #f97316, #ef4444);
}


.chart-card-products-supplier::before {
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.chart-card-products-supplier .chart-safe-fill {
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.chart-card-products-brand::before {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.chart-card-products-brand .chart-safe-fill {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.chart-card-products-group::before {
    background: linear-gradient(90deg, #14b8a6, #22c55e);
}

.chart-card-products-group .chart-safe-fill {
    background: linear-gradient(90deg, #14b8a6, #22c55e);
}

.sales-period-select {
    font-weight: 800;
}

@media (max-width: 860px) {
    .mobile-dashboard .chart-card-products {
        margin-bottom: 0;
    }
}


/* STEP 15 - Periodo analisi vendite solo nei cruscotti articoli */
.sales-period-panel {
    margin: -4px 0 18px 0;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-left: 5px solid #2563eb;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(239,246,255,0.94));
}

.sales-period-panel label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sales-period-panel p {
    margin: 8px 0 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

.sales-period-select {
    width: 100%;
}

@media (max-width: 1100px) {
    .global-filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .sales-period-panel {
        margin-bottom: 14px;
        padding: 12px;
        border-radius: 16px;
    }
}


/* STEP 16 - Pagina statistiche separata */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255,255,255,0.22);
    color: #ffffff;
    font-weight: 800;
    white-space: nowrap;
}

.header-link:hover {
    color: #ffffff;
    text-decoration: none;
    background: rgba(255,255,255,0.24);
}

.statistics-filter-bar {
    grid-template-columns: minmax(260px, 1.25fr) minmax(190px, 0.85fr) minmax(120px, 0.45fr) auto;
}

.statistics-info-card {
    margin-bottom: 22px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(217,226,236,0.95);
    box-shadow: var(--shadow-soft);
}

.statistics-info-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 20px;
}

.statistics-info-card p {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 13px;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.statistics-grid .chart-card {
    min-height: 360px;
}

@media (max-width: 1100px) {
   .statistics-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .header-actions {
        justify-content: flex-start;
    }

   .statistics-filter-bar {
        grid-template-columns: 1fr;
    }

    .statistics-grid {
        display: block;
    }

    .statistics-grid .chart-card {
        min-height: 0;
        margin-bottom: 18px;
    }
}

/* STEP 27 - Statistiche: label articoli completa sopra la barra */
.statistics-body .chart-safe-table,
.statistics-body .chart-safe-table tbody,
.statistics-body .chart-safe-row,
.statistics-body .chart-safe-name,
.statistics-body .chart-safe-bar-cell,
.statistics-body .chart-safe-value {
    display: block;
    width: 100%;
}

.statistics-body .chart-safe-table {
    border-spacing: 0;
}

.statistics-body .chart-safe-row {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #dfe7f1;
    border-radius: 14px;
    background: rgba(255,255,255,0.94);
}

.statistics-body .chart-safe-name {
    max-width: none;
    padding: 0 0 7px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.35;
}

.statistics-body .chart-safe-bar-cell {
    padding: 3px 0;
    border: 0;
    background: transparent;
}

.statistics-body .chart-safe-value {
    padding: 5px 0 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: right;
}


/* STEP 32 - Statistiche: riepilogo PV/stagione selezionata */
.statistics-period-summary {
    display: block;
    margin: 0 0 20px 0;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(59,130,246,0.24);
    background: linear-gradient(135deg, rgba(239,246,255,0.98), rgba(255,255,255,0.96));
    color: #1e3a8a;
    font-weight: 800;
    line-height: 1.4;
    box-shadow: 0 10px 26px rgba(15,23,42,0.08);
}

@media (max-width: 860px) {
    .statistics-period-summary {
        margin-bottom: 16px;
        padding: 12px 14px;
        border-radius: 16px;
        font-size: 13px;
    }
}

/* STEP 31 - Statistiche: confronto venduto netto / acquisti netti / differenza */
.statistics-body .chart-sales-comparison .chart-sales-row {
    padding-bottom: 14px;
}

.statistics-body .chart-sales-name {
    font-weight: 800;
    color: #0f172a;
}

.statistics-body .chart-sales-bars {
    padding: 4px 0 0 0;
}

.statistics-body .chart-sales-metric {
    display: grid;
    grid-template-columns: 128px minmax(120px, 1fr) 78px;
    gap: 10px;
    align-items: center;
    margin: 7px 0;
}

.statistics-body .chart-sales-metric-label {
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    white-space: nowrap;
}

.statistics-body .chart-sales-metric-value {
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.statistics-body .chart-sales-track {
    height: 12px;
}

.statistics-body .chart-sales-net .chart-sales-fill {
    background: linear-gradient(90deg, #16a34a, #86efac);
}

.statistics-body .chart-sales-gross .chart-sales-fill {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.statistics-body .chart-sales-diff .chart-sales-fill {
    background: linear-gradient(90deg, #f59e0b, #facc15);
}

@media (max-width: 860px) {
    .statistics-body .chart-sales-metric {
        grid-template-columns: 1fr 64px;
        gap: 5px 8px;
        margin: 9px 0;
    }

    .statistics-body .chart-sales-metric-label {
        grid-column: 1 / 2;
    }

    .statistics-body .chart-sales-metric-value {
        grid-column: 2 / 3;
    }

    .statistics-body .chart-sales-track {
        grid-column: 1 / 3;
    }
}


/* STEP 33 - Demo statistiche, licenza e richiamo dashboard */
.demo-warning {
    display: block;
    margin: 0 0 18px 0;
    padding: 13px 18px;
    border-radius: 16px;
    border: 1px solid rgba(220, 38, 38, 0.38);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.98), rgba(255,255,255,0.96));
    color: #b91c1c;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 10px 24px rgba(127, 29, 29, 0.11);
}


.demo-warning.license-active {
    border-color: rgba(22, 163, 74, 0.38);
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.98), rgba(255,255,255,0.96));
    color: #15803d;
    box-shadow: 0 10px 24px rgba(21, 128, 61, 0.12);
}

.license-inactive-box {
    margin-top: 24px;
    padding: 28px 30px;
    border-radius: 24px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(220,38,38,0.25);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.license-inactive-box strong {
    display: block;
    color: #b91c1c;
    font-size: 28px;
    font-weight: 900;
}

.license-inactive-box p {
    margin: 10px 0 0 0;
    color: var(--muted);
    font-weight: 700;
}

.stats-callout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(254, 243, 199, 0.96);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.38);
    font-weight: 900;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(146, 64, 14, 0.12);
}

.stats-link-highlight {
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22);
}

.statistics-body .chart-sales-diff-pct .chart-sales-fill {
    background: linear-gradient(90deg, #d97706, #fde047);
}

@media (max-width: 860px) {
    .stats-callout {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
}


/* STEP 40 - Statistiche swipe mobile come dashboard incassi */
@media (max-width: 860px) {
    .statistics-body .statistics-mobile-nav {
        margin-top: 0;
        margin-bottom: 14px;
    }

    .statistics-body .statistics-grid.mobile-dashboard {
        display: flex !important;
        gap: 0;
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        grid-template-columns: none !important;
    }

    .statistics-body .statistics-grid.mobile-dashboard > .mobile-slide {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        margin: 0;
        padding: 0 1px 12px 1px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        clear: none;
        box-sizing: border-box;
    }

    .statistics-body .statistics-grid.mobile-dashboard .chart-card {
        min-height: 60vh;
        margin-bottom: 0;
    }

    .statistics-body .statistics-mobile-dots {
        display: flex;
    }
}


/* STEP 41 - Statistiche: barra unica caricato/venduto e solo differenza percentuale */
.statistics-body .chart-sales-combined {
    margin: 8px 0 10px 0;
}

.statistics-body .chart-sales-combined-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    color: #334155;
}

.statistics-body .chart-sales-combined-label strong {
    color: #0f172a;
    font-weight: 900;
}

.statistics-body .chart-sales-combined-track {
    position: relative;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, #dc2626, #f87171);
    border: 1px solid rgba(220, 38, 38, 0.22);
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.18);
}

.statistics-body .chart-sales-combined-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #16a34a, #86efac);
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.12);
}

.statistics-body .chart-sales-diff-pct .chart-sales-metric-label {
    color: #92400e;
}

@media (max-width: 860px) {
    .statistics-body .chart-sales-combined-label {
        display: block;
        line-height: 1.55;
    }

    .statistics-body .chart-sales-combined-label span {
        display: block;
    }
}

/* STEP 44 - Lista articoli venduti oggi */
.sold-today-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    background: #ffffff;
}

.sold-today-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 13px;
}

.sold-today-table th {
    padding: 12px 14px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(148, 163, 184, 0.32);
    text-align: left;
}

.sold-today-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    color: #0f172a;
    vertical-align: top;
}

.sold-today-table tbody tr:last-child td {
    border-bottom: none;
}

.sold-today-table tbody tr:hover td {
    background: #f8fafc;
}

.sold-today-num {
    text-align: right !important;
    white-space: nowrap;
    font-weight: 800;
}

@media (max-width: 860px) {
    .sold-today-table {
        min-width: 560px;
        font-size: 12px;
    }

    .sold-today-table th,
    .sold-today-table td {
        padding: 10px 11px;
    }
}


/* STEP 48 - Login pulito e pulsante statistiche piu visibile */
.stats-link-highlight {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd) !important;
    color: #075985 !important;
    border: 1px solid rgba(14, 116, 144, 0.42) !important;
    box-shadow: 0 10px 22px rgba(2, 132, 199, 0.22), 0 0 0 4px rgba(186, 230, 253, 0.36) !important;
}

.stats-link-highlight:hover {
    background: linear-gradient(135deg, #bae6fd, #7dd3fc) !important;
    color: #0c4a6e !important;
    border-color: rgba(14, 116, 144, 0.56) !important;
    transform: translateY(-1px);
}

@media (max-width: 860px) {
    .stats-link-highlight {
        width: 100%;
        min-height: 46px;
        font-size: 15px;
    }
}

/* STEP 56 - Confronto acquisti per fascia oraria settimanale */
.chart-hour-compare .chart-period-note {
    margin: 0 0 14px 0;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 13px;
    line-height: 1.5;
}

.chart-compare-table .chart-safe-bar-cell {
    padding-top: 10px;
    padding-bottom: 10px;
}

.chart-compare-line {
    display: grid;
    grid-template-columns: 116px minmax(90px, 1fr) 38px;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.chart-compare-label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.chart-compare-number {
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    text-align: right;
}

.chart-hour-compare .chart-compare-track {
    height: 11px;
}

.chart-hour-compare .chart-compare-current {
    height: 11px;
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.chart-hour-compare .chart-compare-previous {
    height: 11px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

@media (max-width: 620px) {
    .chart-compare-line {
        grid-template-columns: 1fr 44px;
        gap: 5px 8px;
    }

    .chart-compare-label {
        grid-column: 1 / 3;
    }

    .chart-compare-number {
        text-align: right;
    }
}


/* STEP 60 - Messaggio caricamento gradevole */
.loading-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(5px);
}

.loading-overlay.is-visible {
    display: flex !important;
}

.loading-card {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 440px;
    width: min(440px, 92vw);
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
}

.loading-spinner {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    animation: loadingSpin 0.85s linear infinite;
}

.loading-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #0f172a;
}

.loading-copy strong {
    font-size: 16px;
    line-height: 1.25;
    font-weight: 900;
}

.loading-copy span {
    font-size: 13px;
    line-height: 1.45;
    color: #475569;
    font-weight: 700;
}

@keyframes loadingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
    .loading-card {
        align-items: flex-start;
        padding: 18px;
        border-radius: 19px;
    }

    .loading-spinner {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
}

/* STEP 62 - Statistiche: data primo carico nelle classifiche articoli */
.statistics-body .chart-sales-firstload {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.35;
}
