*,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        :root {
            --navy: #0A1628;
            --navy-light: #132240;
            --accent: #2563EB;
            --text: #0F172A;
            --text-muted: #64748B;
            --border: #E2E8F0;
            --bg: #F0F4F8;
            --white: #FFFFFF;
            --green: #16A34A;
            --green-bg: #F0FDF4;
            --red: #DC2626;
            --red-bg: #FEF2F2;
            --sidebar-w: 108px;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }

        /* ═══ NAVBAR ═══ */
        .navbar {
            background: var(--navy);
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 200;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
        }

        .nav-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            color: white;
            text-decoration: none;
        }

        .nav-brand-icon {
            width: 32px;
            height: 32px;
            background: rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .nav-brand-icon svg {
            width: 18px;
            height: 18px;
            fill: white;
        }

        .nav-brand span {
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -0.2px;
        }

        /* ═══ SIDEBAR ═══ */
        .sidebar {
            position: fixed;
            top: 60px;
            left: 0;
            bottom: 0;
            width: var(--sidebar-w);
            background: var(--navy);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 16px 0;
            gap: 4px;
            z-index: 150;
            border-right: 1px solid rgba(255, 255, 255, 0.06);
        }

        .sidebar-item {
            width: 84px;
            height: 76px;
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            cursor: pointer;
            color: rgba(255, 255, 255, 0.45);
            transition: background 0.15s, color 0.15s;
            border: none;
            background: transparent;
            font-family: 'Inter', sans-serif;
            position: relative;
        }

        .sidebar-item:hover {
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.85);
        }

        .sidebar-item.active {
            background: rgba(255, 255, 255, 0.12);
            color: white;
        }

        .sidebar-item svg {
            width: 26px;
            height: 26px;
            fill: currentColor;
            flex-shrink: 0;
        }

        .sidebar-item span {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.3px;
            text-transform: uppercase;
        }

        .sidebar-divider {
            width: 32px;
            height: 1px;
            background: rgba(255, 255, 255, 0.08);
            margin: 8px 0;
        }

        /* Logout in fondo */
        .sidebar-bottom {
            margin-top: auto;
        }

        /* ═══ MAIN CONTENT ═══ */
        .content {
            margin-left: var(--sidebar-w);
            margin-top: 60px;
            padding: 32px 28px 60px;
            min-height: calc(100vh - 60px);
        }

        .content:has(#page-calendario.active) {
            padding: 0;
            height: calc(100vh - 60px);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        html:has(#page-calendario.active),
        body:has(#page-calendario.active) {
            overflow: hidden;
            height: 100%;
        }

        /* ═══ PAGINE ═══ */
        .page {
            display: none;
        }

        .page.active {
            display: block;
        }

        .page.active.page-cal-full {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            padding: 0 !important;
        }

        .page-cal-full .page-header {
            padding: 20px 28px 0;
            margin-bottom: 12px;
            flex-shrink: 0;
        }

        .page-cal-full .gcal-wrap {
            flex: 1;
            min-height: 0;
            margin: 0 16px 16px;
        }

        .page-header {
            margin-bottom: 28px;
        }

        .page-header h1 {
            font-size: 24px;
            font-weight: 700;
            color: var(--navy);
            letter-spacing: -0.4px;
        }

        .page-header p {
            font-size: 14px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* ═══ STATS ═══ */
        .stats-bar {
            display: flex;
            gap: 12px;
            margin-bottom: 28px;
            flex-wrap: wrap;
        }

        .stat-pill {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            border-radius: 999px;
            font-size: 13px;
            font-weight: 500;
            border: 1.5px solid var(--border);
            background: white;
        }

        .stat-pill .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .stat-pill.total .dot {
            background: var(--navy);
        }

        .stat-pill.available .dot {
            background: var(--green);
        }

        .stat-pill.busy .dot {
            background: var(--red);
        }

        /* ═══ FLEET GRID ═══ */
        .fleet-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
            gap: 28px;
        }

        #page-flotta.active {
            max-width: 1080px; /* 5 card da 190px + gap più ampio: mai più di 5 per riga */
            margin: 0 auto;
        }

        #page-flotta .page-header {
            text-align: center;
        }

        #page-flotta .stats-bar {
            justify-content: center;
        }

        /* ═══ BOAT CARD ═══ */
        .boat-card {
            border-radius: 14px;
            overflow: hidden;
            transition: transform 0.15s, box-shadow 0.15s;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
            position: relative;
        }

        .boat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 8px 28px rgba(0, 0, 0, 0.1);
        }

        .boat-color-band {
            height: 110px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .boat-card.disponibile .boat-color-band {
            background: var(--green);
        }

        .boat-card.occupata .boat-color-band {
            background: var(--red);
        }

        .boat-card.imminente .boat-color-band {
            background: #D97706;
        }

        .boat-card.imminente .toggle-btn {
            background: #FEF3C7;
            color: #380e92;
        }

        .boat-card.imminente .toggle-btn:hover {
            background: #FDE68A;
        }

        .boat-imminente-badge {
            font-size: 11px;
            font-weight: 500;
            color: #92400E;
            background: #FEF3C7;
            border-radius: 6px;
            padding: 4px 8px;
            margin: 6px 0 4px;
        }

        .boat-color-band svg {
            width: 56px;
            height: 56px;
            fill: white;
            opacity: 0.95;
            filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
        }

        .status-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            padding: 3px 8px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.22);
            color: white;
        }

        .boat-info {
            background: white;
            padding: 14px 16px 16px;
            text-align: center;
        }

        .boat-name {
            font-size: 15px;
            font-weight: 600;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .boat-meta {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 3px;
        }

        .boat-footer {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 12px;
        }

        .boat-cost {
            font-size: 14px;
            font-weight: 700;
            color: var(--navy);
        }

        .toggle-btn {
            font-family: 'Inter', sans-serif;
            font-size: 11px;
            font-weight: 600;
            padding: 15px 40px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            transition: background 0.15s;
           
        }

        .boat-card.disponibile .toggle-btn {
            background: var(--red-bg);
            color: var(--red);
        }

        .boat-card.disponibile .toggle-btn:hover {
            background: #FECACA;
        }

        .boat-card.occupata .toggle-btn {
            background: var(--green-bg);
            color: var(--green);
        }

        .boat-card.occupata .toggle-btn:hover {
            background: #BBF7D0;
        }

        .btn-delete {
            position: absolute;
            top: 10px;
            left: 10px;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.2);
            border: none;
            color: white;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.15s;
        }

        .boat-card:hover .btn-delete {
            opacity: 1;
        }

        .btn-delete:hover {
            background: rgba(220, 38, 38, 0.7) !important;
        }

        /* ═══ EMPTY / LOADING ═══ */
        .empty-state {
            grid-column: 1 / -1;
            text-align: center;
            padding: 64px 24px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .loading-state {
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 60px;
            gap: 14px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .loading-spinner {
            width: 28px;
            height: 28px;
            border: 3px solid var(--border);
            border-top-color: var(--navy);
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* ═══ PAGINA STORICO ═══ */
        .storico-table {
            width: 100%;
            background: white;
            border-radius: 14px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
            border: 1px solid var(--border);
        }

        .storico-table table {
            width: 100%;
            min-width: 760px; /* forza lo scroll orizzontale invece di schiacciare le colonne su schermi stretti */
            border-collapse: collapse;
        }

        .storico-table th {
            background: var(--bg);
            padding: 12px 16px;
            text-align: left;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid var(--border);
        }

        .storico-table td {
            padding: 13px 16px;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            color: var(--text);
        }

        .storico-table tr:last-child td {
            border-bottom: none;
        }

        .storico-table tr:hover td {
            background: var(--bg);
        }

        .badge-ass {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            background: #EFF6FF;
            color: var(--accent);
        }

        .badge-no-ass {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            background: var(--bg);
            color: var(--text-muted);
        }

        .storico-filters {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            align-items: center;
            flex-wrap: wrap;
        }

        .storico-filters input[type="date"] {
            padding: 8px 12px;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            background: white;
            color: var(--text);
            outline: none;
        }

        .storico-filters input[type="date"]:focus {
            border-color: var(--accent);
        }

        .btn-filter {
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            font-weight: 500;
            padding: 8px 16px;
            border-radius: 8px;
            border: 1.5px solid var(--border);
            background: white;
            color: var(--text);
            cursor: pointer;
        }

        .btn-filter:hover {
            background: var(--bg);
        }

        .btn-filter.primary {
            background: var(--navy);
            color: white;
            border-color: var(--navy);
        }

        .btn-filter.primary:hover {
            background: var(--navy-light);
        }

        /* ═══ PAGINA RIEPILOGO ═══ */
        .riepilogo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 28px;
        }

        /* ── Blocco/offuscamento delle sole card guadagni (Storico) ── */
        .riepilogo-lock-wrap {
            position: relative;
        }

        .riepilogo-lock-wrap .riepilogo-grid.bloccato {
            filter: blur(7px);
            user-select: none;
            pointer-events: none;
        }

        .riepilogo-lock-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            color: var(--text);
            font-size: 13px;
            font-weight: 600;
            background: rgba(255, 255, 255, 0.35);
            border-radius: 14px;
        }

        .riepilogo-lock-overlay:hover {
            background: rgba(255, 255, 255, 0.5);
        }

        .riepilogo-card {
            background: white;
            border-radius: 14px;
            padding: 20px;
            border: 1px solid var(--border);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        }

        .riepilogo-card .label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.4px;
            margin-bottom: 8px;
        }

        .riepilogo-card .value {
            font-size: 28px;
            font-weight: 700;
            color: var(--navy);
            letter-spacing: -0.5px;
        }

        .riepilogo-card .sub {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .riepilogo-card.green .value {
            color: var(--green);
        }

        .riepilogo-card.accent .value {
            color: var(--accent);
        }

        /* ═══ PAGINA IMPOSTAZIONI ═══ */
        .settings-card {
            background: white;
            border-radius: 14px;
            padding: 24px;
            border: 1px solid var(--border);
            margin-bottom: 16px;
            max-width: 520px;
        }

        #page-impostazioni.active {
            max-width: 560px;
            margin: 0 auto;
        }

        .settings-card h3 {
            font-size: 15px;
            font-weight: 600;
            color: var(--navy);
            margin-bottom: 16px;
        }

        .settings-field {
            margin-bottom: 14px;
        }

        .settings-field label {
            display: block;
            font-size: 12px;
            font-weight: 500;
            color: var(--text-muted);
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }

        .settings-field input,
        .settings-field select {
            width: 100%;
            padding: 10px 12px;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            color: var(--text);
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: 8px;
            outline: none;
        }

        .settings-field input:focus,
        .settings-field select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
            background: white;
        }

        .btn-save {
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            font-weight: 600;
            color: white;
            background: var(--navy);
            border: none;
            border-radius: 8px;
            padding: 10px 22px;
            cursor: pointer;
        }

        .btn-save:hover {
            background: var(--navy-light);
        }

        /* ═══ TOAST ═══ */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: var(--navy);
            color: white;
            font-size: 13px;
            font-weight: 500;
            padding: 12px 20px;
            border-radius: 10px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            transform: translateY(80px);
            opacity: 0;
            transition: transform 0.25s ease, opacity 0.25s ease;
            z-index: 500;
        }

        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        /* ═══ MODALS ═══ */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(10, 22, 40, 0.6);
            backdrop-filter: blur(4px);
            z-index: 300;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }

        .modal-overlay.open {
            opacity: 1;
            pointer-events: all;
        }

        .modal {
            background: white;
            border-radius: 18px;
            width: 100%;
            max-width: 580px;
            max-height: 92vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            transform: translateY(16px);
            transition: transform 0.2s ease;
        }

        .modal-overlay.open .modal {
            transform: translateY(0);
        }

        .modal-sm {
            max-width: 420px;
        }

        .modal-lg {
            max-width: 720px;
        }

        .modal-header {
            padding: 22px 24px 18px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            position: sticky;
            top: 0;
            background: white;
            border-radius: 18px 18px 0 0;
            border-bottom: 1px solid var(--border);
            z-index: 2;
        }

        .modal-header-left h2 {
            font-size: 18px;
            font-weight: 700;
            color: var(--navy);
        }

        .modal-header-left p {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 3px;
        }

        .modal-close {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: var(--bg);
            border: none;
            cursor: pointer;
            font-size: 16px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .modal-close:hover {
            background: var(--border);
        }

        .modal-alert {
            display: none;
            margin: 12px 24px 0;
            padding: 10px 14px;
            background: #FEF2F2;
            border: 1px solid #FECACA;
            border-radius: 8px;
            color: var(--red);
            font-size: 13px;
            font-weight: 500;
            align-items: center;
            gap: 8px;
        }

        .modal-alert.visible {
            display: flex;
        }

        .modal-body {
            padding: 20px 24px;
        }

        .modal-section {
            margin-bottom: 22px;
        }

        .modal-section-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.6px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .modal-section-title::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border);
        }

        .modal-grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .modal-field {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .modal-field label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-muted);
        }

        .modal-field input,
        .modal-field select {
            padding: 10px 12px;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            color: var(--text);
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: 8px;
            outline: none;
            width: 100%;
        }

        .modal-field input:focus,
        .modal-field select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
            background: white;
        }

        .modal-field input.error {
            border-color: var(--red);
            background: #FEF2F2;
        }

        .orari-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 12px;
        }

        .durata-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            color: var(--navy);
            padding: 10px 8px;
            text-align: center;
            min-height: 42px;
        }

        .assicurazione-box {
            border: 1.5px solid var(--border);
            border-radius: 10px;
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            user-select: none;
            transition: border-color 0.15s, background 0.15s;
        }

        .assicurazione-box:hover {
            border-color: var(--accent);
        }

        .assicurazione-box.selected {
            border-color: var(--accent);
            background: #EFF6FF;
        }

        .assicurazione-info strong {
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
        }

        .assicurazione-info span {
            display: block;
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .toggle-switch {
            width: 42px;
            height: 24px;
            border-radius: 999px;
            background: var(--border);
            position: relative;
            transition: background 0.2s;
            flex-shrink: 0;
        }

        .toggle-switch::after {
            content: '';
            position: absolute;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: white;
            top: 3px;
            left: 3px;
            transition: transform 0.2s;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }

        .assicurazione-box.selected .toggle-switch {
            background: var(--accent);
        }

        .assicurazione-box.selected .toggle-switch::after {
            transform: translateX(18px);
        }

        .pagamento-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }

        .pagamento-tab {
            flex: 1;
            padding: 10px;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            background: var(--bg);
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
        }

        .pagamento-tab.active {
            border-color: var(--accent);
            background: #EFF6FF;
            color: var(--accent);
            font-weight: 600;
        }

        .pagamento-split {
            display: none;
            gap: 12px;
        }

        .pagamento-split.visible {
            display: grid;
            grid-template-columns: 1fr 1fr;
        }

        .split-hint {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 6px;
        }

        .firma-container {
            border: 1.5px solid var(--border);
            border-radius: 10px;
            overflow: hidden;
            position: relative;
            background: #FAFAFA;
        }

        .firma-container.error {
            border-color: var(--red);
        }

        .firma-container canvas {
            display: block;
            width: 100%;
            height: 130px;
            cursor: crosshair;
            touch-action: none;
        }

        .firma-placeholder {
            position: absolute;
            inset: 0 0 40px 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: #94A3B8;
            pointer-events: none;
            gap: 6px;
        }

        .firma-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            border-top: 1px solid var(--border);
            background: white;
        }

        .firma-toolbar span {
            font-size: 11px;
            color: var(--text-muted);
        }

        .btn-clear-firma {
            font-family: 'Inter', sans-serif;
            font-size: 11px;
            font-weight: 500;
            color: var(--red);
            background: var(--red-bg);
            border: none;
            border-radius: 5px;
            padding: 4px 10px;
            cursor: pointer;
        }

        .totale-card {
            background: var(--navy);
            border-radius: 10px;
            padding: 16px 18px;
        }

        .totale-row-item {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.6);
            margin-bottom: 6px;
        }

        .totale-row-item.main {
            color: white;
            font-size: 17px;
            font-weight: 700;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(255, 255, 255, 0.15);
            margin-bottom: 0;
        }

        .modal-confirm {
            text-align: center;
            padding: 32px 24px;
        }

        .modal-confirm p {
            font-size: 15px;
            color: var(--text);
        }

        .modal-footer {
            padding: 16px 24px 24px;
            display: flex;
            gap: 10px;
            border-top: 1px solid var(--border);
        }

        .btn-modal-cancel {
            flex: 1;
            padding: 12px;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-muted);
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
        }

        .btn-modal-cancel:hover {
            background: var(--border);
        }

        .btn-modal-confirm {
            flex: 2;
            padding: 12px;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            font-weight: 600;
            color: white;
            background: var(--navy);
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }

        .btn-modal-confirm:hover {
            background: var(--navy-light);
        }

        .btn-modal-confirm:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        @media (max-width: 640px) {
            .content {
                padding: 20px 16px 48px;
            }

            .modal-grid-2 {
                grid-template-columns: 1fr;
            }

            .orari-row {
                grid-template-columns: 1fr 1fr;
            }

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

        /* ═══ CALENDARIO VISTA GIORNALIERA ═══ */

        /* Layout principale */
        .gcal-wrap {
            display: flex;
            gap: 0;
            min-height: 500px;
            background: white;
            border-radius: 16px;
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
        }

        /* Mini calendario a sinistra */
        .gcal-mini {
            width: 240px;
            flex-shrink: 0;
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            background: white;
            padding: 16px;
        }

        .gcal-mini-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .gcal-mini-nav span {
            font-size: 13px;
            font-weight: 600;
            color: var(--navy);
        }

        .gcal-mini-navbtn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 16px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .gcal-mini-navbtn:hover {
            background: var(--bg);
        }

        .gcal-mini-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 1px;
        }

        .gcal-mini-dh {
            text-align: center;
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            padding: 4px 0;
        }

        .gcal-mini-day {
            text-align: center;
            font-size: 12px;
            font-weight: 400;
            color: var(--text);
            padding: 4px 2px;
            border-radius: 50%;
            cursor: pointer;
            aspect-ratio: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.12s;
        }

        .gcal-mini-day:hover {
            background: var(--bg);
        }

        .gcal-mini-day.empty {
            pointer-events: none;
            color: transparent;
        }

        .gcal-mini-day.today {
            background: var(--accent);
            color: white;
            font-weight: 700;
        }

        .gcal-mini-day.selected {
            background: #DBEAFE;
            color: var(--accent);
            font-weight: 700;
        }

        .gcal-mini-day.today.selected {
            background: var(--accent);
            color: white;
        }

        .gcal-mini-day.has-events::after {
            content: '';
            display: block;
            width: 4px;
            height: 4px;
            background: var(--accent);
            border-radius: 50%;
            margin: 1px auto 0;
        }

        .gcal-mini-day.today.has-events::after {
            background: white;
        }

        .gcal-mini-div {
            height: 1px;
            background: var(--border);
            margin: 12px 0;
        }

        /* Info giorno selezionato nel mini */
        .gcal-mini-dayinfo {
            font-size: 11px;
            color: var(--text-muted);
        }

        .gcal-mini-dayinfo strong {
            display: block;
            font-size: 22px;
            font-weight: 700;
            color: var(--navy);
            letter-spacing: -0.5px;
            line-height: 1;
        }

        .gcal-mini-dayinfo span {
            font-size: 12px;
        }

        .gcal-mini-addBtn {
            margin-top: 12px;
            width: 100%;
            padding: 9px;
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            font-weight: 600;
            color: white;
            background: var(--accent);
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }

        .gcal-mini-addBtn:hover {
            background: #1D4ED8;
        }

        /* Area principale */
        .gcal-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow: hidden;
            min-height: 0;
        }

        .gcal-hscroll-wrap {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .gcal-hscroll-inner {
            flex: 1;
            min-height: 0;
            overflow-y: scroll;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Header con nome barche */
        .gcal-header {
            display: flex;
            border-bottom: 1px solid var(--border);
            background: white;
            flex-shrink: 0;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .gcal-time-col-head {
            width: 52px;
            flex-shrink: 0;
            border-right: 1px solid var(--border);
        }

        .gcal-boat-head {
            flex: 1 0 150px;
            min-width: 150px;
            padding: 10px 8px;
            text-align: center;
            font-size: 12px;
            font-weight: 600;
            color: var(--navy);
            border-right: 1px solid var(--border);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .gcal-boat-head:last-child {
            border-right: none;
        }

        .gcal-boat-head .boat-stato {
            display: inline-block;
            font-size: 10px;
            font-weight: 500;
            padding: 1px 6px;
            border-radius: 999px;
            margin-top: 2px;
        }

        .gcal-boat-head .boat-stato.disp {
            background: var(--green-bg);
            color: var(--green);
        }

        .gcal-boat-head .boat-stato.occ {
            background: var(--red-bg);
            color: var(--red);
        }

        /* Griglia oraria */
        .gcal-scroll {
            flex-shrink: 0;
            overflow-x: visible;
            position: relative;
        }

        .gcal-grid {
            display: flex;
            position: relative;
        }

        .gcal-time-col {
            width: 52px;
            flex-shrink: 0;
            border-right: 1px solid var(--border);
        }

        .gcal-time-slot {
            height: 60px;
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
            padding: 4px 6px 0 0;
            font-size: 10px;
            font-weight: 500;
            color: var(--text-muted);
        }

        .gcal-time-slot:first-child {
            visibility: hidden;
        }

        .gcal-cols {
            flex: 1;
            display: flex;
            position: relative;
        }

        .gcal-col {
            flex: 1 0 150px;
            min-width: 150px;
            border-right: 1px solid var(--border);
            position: relative;
            cursor: pointer;
        }

        .gcal-col:last-child {
            border-right: none;
        }

        .gcal-col-slot {
            height: 60px;
            border-bottom: 1px solid #F1F5F9;
            transition: background 0.1s;
        }

        .gcal-col-slot:hover {
            background: #F0F7FF;
        }

        .gcal-col-slot.half {
            border-bottom: 1px dashed #E9EEF4;
        }

        /* Blocco prenotazione */
        .gcal-event {
            position: absolute;
            left: 3px;
            right: 3px;
            border-radius: 6px;
            padding: 4px 7px;
            font-size: 11px;
            cursor: pointer;
            overflow: visible;
            transition: filter 0.1s, box-shadow 0.1s;
            z-index: 5;
            border-left: 3px solid transparent;
        }

        .gcal-event:hover {
            filter: brightness(0.93);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            z-index: 6;
        }

        .gcal-event .ev-time {
            font-size: 10px;
            font-weight: 500;
            opacity: 0.8;
        }

        .gcal-event .ev-name {
            font-weight: 700;
            font-size: 12px;
            line-height: 1.2;
        }

        .gcal-event .ev-meta {
            font-size: 10px;
            opacity: 0.75;
            margin-top: 1px;
        }

        .gcal-event .ev-badge {
            display: inline-block;
            font-size: 9px;
            font-weight: 600;
            padding: 1px 5px;
            border-radius: 3px;
            background: rgba(0, 0, 0, 0.12);
            margin-top: 3px;
        }

        .ev-delete {
            position: absolute;
            top: -6px;
            right: -6px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #DC2626;
            border: 2px solid white;
            color: white;
            font-size: 10px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
            line-height: 1;
            padding: 0;
            z-index: 30;
            pointer-events: all;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
            touch-action: manipulation;
        }

        .ev-delete:hover {
            background: #B91C1C;
        }

        .ev-delete:active {
            transform: scale(0.9);
        }

        /* Linea ora corrente */
        .gcal-now-line {
            position: absolute;
            left: 0;
            right: 0;
            height: 2px;
            background: #EF4444;
            z-index: 8;
            pointer-events: none;
        }

        .gcal-now-line::before {
            content: '';
            position: absolute;
            left: -5px;
            top: -4px;
            width: 10px;
            height: 10px;
            background: #EF4444;
            border-radius: 50%;
        }

        /* Nav giorno */
        .gcal-day-nav {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            border-bottom: 1px solid var(--border);
            background: white;
            flex-shrink: 0;
        }

        .gcal-day-nav-btn {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 18px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .gcal-day-nav-btn:hover {
            background: var(--bg);
        }

        .gcal-day-label {
            font-size: 16px;
            font-weight: 600;
            color: var(--navy);
        }

        .gcal-today-btn {
            font-family: 'Inter', sans-serif;
            font-size: 12px;
            font-weight: 500;
            padding: 5px 14px;
            border-radius: 999px;
            border: 1.5px solid var(--border);
            background: white;
            color: var(--text-muted);
            cursor: pointer;
            margin-left: 8px;
        }

        .gcal-today-btn:hover {
            background: var(--bg);
        }

        /* Banner */
        .banner-imminenti {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            padding: 8px 16px;
            background: #FEF3C7;
            border-bottom: 2px solid #F59E0B;
            color: #92400E;
            font-size: 12px;
            font-weight: 500;
        }

        .banner-item {
            display: inline-block;
            background: white;
            border-radius: 6px;
            padding: 3px 10px;
            margin: 2px;
        }


        /* ═══ CALENDARIO MOBILE ═══ */
        @media (max-width: 768px) {

            /* Sidebar più stretta */
            :root {
                --sidebar-w: 60px;
            }

            .sidebar-item span {
                font-size: 8px;
                letter-spacing: 0;
            }

            .sidebar-item {
                width: 48px;
                height: 48px;
            }

            .sidebar-item svg {
                width: 18px;
                height: 18px;
            }

            /* Nascondi mini calendario laterale */
            .gcal-mini {
                display: none;
            }

            .gcal-wrap {
                flex-direction: column;
            }

            /* Nav giorno compatto con data cliccabile */
            .gcal-day-nav {
                padding: 8px 10px;
                gap: 4px;
                flex-shrink: 0;
            }

            .gcal-day-label {
                font-size: 13px;
                cursor: pointer;
                text-decoration: underline dotted;
            }

            .gcal-today-btn {
                font-size: 11px;
                padding: 4px 10px;
            }

            /* Header + scroll in un unico contenitore scrollabile */
            .gcal-main {
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }

            /* Wrapper unico per header barche + griglia — scroll orizzontale condiviso */
            .gcal-hscroll-wrap {
                flex: 1;
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }

            .gcal-hscroll-inner {
                flex: 1;
                overflow: auto;
            }

            /* Header barche */
            .gcal-header {
                overflow-x: visible;
                min-width: max-content;
                flex-shrink: 0;
            }

            .gcal-boat-head {
                padding: 6px 4px;
                font-size: 11px;
                min-width: 85px;
            }

            .gcal-boat-head .boat-stato {
                display: none;
            }

            .gcal-boat-head div:last-child {
                display: none;
            }

            /* Colonna orari sticky a sinistra */
            .gcal-time-col {
                width: 46px;
                flex-shrink: 0;
                position: sticky;
                left: 0;
                background: white;
                z-index: 5;
                border-right: 1px solid var(--border);
            }

            .gcal-time-col-head {
                width: 46px;
                flex-shrink: 0;
                position: sticky;
                left: 0;
                background: white;
                z-index: 6;
            }

            .gcal-time-slot {
                font-size: 10px;
                width: 46px;
                display: flex;
                align-items: flex-start;
                justify-content: flex-end;
                padding: 4px 6px 0 0;
            }

            /* Griglia - scroll gestito da hscroll-inner */
            .gcal-scroll {
                overflow: visible;
                flex: none;
            }

            .gcal-grid {
                min-width: max-content;
            }

            .gcal-cols {
                min-width: max-content;
            }

            .gcal-col {
                min-width: 85px;
            }

            /* Slot ora */
            .gcal-col-slot {
                height: 60px;
            }

            .gcal-time-slot {
                height: 60px;
            }

            /* Blocchi evento compatti */
            .gcal-event {
                padding: 2px 4px;
                left: 1px;
                right: 1px;
            }

            .gcal-event .ev-time {
                font-size: 9px;
            }

            .gcal-event .ev-name {
                font-size: 10px;
            }

            .gcal-event .ev-meta {
                display: none;
            }

            .gcal-event .ev-badge {
                display: none;
            }

            .ev-delete {
                width: 18px;
                height: 18px;
                font-size: 9px;
                top: -5px;
                right: -5px;
            }
        }

        @media (max-width: 480px) {
            .gcal-day-label {
                font-size: 12px;
            }
        }

        /* Mini calendario popup su mobile */
        .gcal-mini-popup-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(10, 22, 40, 0.5);
            z-index: 400;
            align-items: flex-start;
            justify-content: center;
            padding-top: 80px;
        }

        .gcal-mini-popup-overlay.open {
            display: flex;
        }

        .gcal-mini-popup {
            background: white;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            width: 300px;
        }