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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #383E42 0%, #2a2e31 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: #f8f9fa;
            border-radius: 15px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            padding: 30px;
            border: 3px solid #383E42;
            overflow: hidden;
            box-sizing: border-box;
        }

        h1 {
            background: linear-gradient(135deg, #4A0010 0%, #383E42 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-align: center;
            margin-bottom: 10px;
            font-size: 2em;
            font-weight: 700;
        }

        h2 {
            color: #383E42;
            margin-top: 30px;
            margin-bottom: 15px;
            border-left: 4px solid #4A0010;
            padding-left: 12px;
        }

        .subtitle {
            text-align: center;
            color: #383E42;
            margin-bottom: 30px;
            font-size: 0.9em;
            font-weight: 500;
        }

        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
            border-bottom: 2px solid #383E42;
            flex-wrap: wrap;
            width: 100%;
            box-sizing: border-box;
        }

        .tab {
            padding: 12px 20px;
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 0.95em;
            color: #666;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
            flex-shrink: 0;
        }

        .tab:hover {
            color: #4A0010;
            background: rgba(74, 0, 16, 0.05);
        }

        .tab.active {
            color: #4A0010;
            border-bottom-color: #4A0010;
            font-weight: 600;
            background: linear-gradient(180deg, transparent 0%, rgba(74, 0, 16, 0.05) 100%);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Previene visualizzazione di tab duplicati o fuori posto */
        .tab-content .tabs,
        .tab-content .tab {
            display: none !important;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            color: #333;
            font-weight: 500;
        }

        input, select {
            width: 100%;
            padding: 10px;
            border: 2px solid #d0d0d0;
            border-radius: 5px;
            font-size: 1em;
            transition: all 0.3s;
            background: white;
        }

        input:focus, select:focus {
            outline: none;
            border-color: #4A0010;
            box-shadow: 0 0 0 3px rgba(74, 0, 16, 0.1);
        }

        .row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        button {
            background: linear-gradient(135deg, #4A0010 0%, #6b0017 100%);
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(74, 0, 16, 0.3);
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(74, 0, 16, 0.4);
        }

        button:active {
            transform: translateY(0);
        }

        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .btn-secondary {
            background: linear-gradient(135deg, #383E42 0%, #4a5157 100%);
            box-shadow: 0 4px 15px rgba(56, 62, 66, 0.3);
        }

        .btn-secondary:hover {
            box-shadow: 0 6px 20px rgba(56, 62, 66, 0.4);
        }

        .btn-success {
            background: linear-gradient(135deg, #2d5016 0%, #3d6b1f 100%);
            box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
        }

        .btn-success:hover {
            box-shadow: 0 6px 20px rgba(45, 80, 22, 0.4);
        }

        .btn-warning {
            background: linear-gradient(135deg, #c05621 0%, #d97236 100%);
            box-shadow: 0 4px 15px rgba(192, 86, 33, 0.3);
        }

        .btn-warning:hover {
            box-shadow: 0 6px 20px rgba(192, 86, 33, 0.4);
        }

        .btn-danger {
            background: linear-gradient(135deg, #8B0000 0%, #B22222 100%);
            box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
        }

        .btn-danger:hover {
            box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
        }

        .btn-small {
            padding: 6px 12px;
            font-size: 0.85em;
            font-weight: 500;
        }

        .stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-bottom: 30px;
            max-width: 100%;
        }

        .stat-card {
            background: linear-gradient(135deg, #383E42 0%, #4a5157 100%);
            color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(56, 62, 66, 0.3);
            border: 2px solid rgba(255, 255, 255, 0.1);
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .stat-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(56, 62, 66, 0.4);
        }

        .stat-card.warning {
            background: linear-gradient(135deg, #4A0010 0%, #6b0017 100%);
            border: 2px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 5px 15px rgba(74, 0, 16, 0.4);
        }

        .stat-card.warning:hover {
            box-shadow: 0 8px 25px rgba(74, 0, 16, 0.5);
        }

        .stat-card.danger {
            background: linear-gradient(135deg, #8b0000 0%, #b30000 100%);
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 5px 15px rgba(139, 0, 0, 0.5);
            animation: pulse-danger 2s ease-in-out infinite;
        }

        .stat-card.danger:hover {
            box-shadow: 0 8px 25px rgba(139, 0, 0, 0.6);
        }

        .stat-card.success {
            background: linear-gradient(135deg, #2d5016 0%, #3d6b1f 100%);
            border: 2px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 5px 15px rgba(45, 80, 22, 0.4);
        }

        .stat-card.success:hover {
            box-shadow: 0 8px 25px rgba(45, 80, 22, 0.5);
        }

        .stat-card.alert-yellow {
            background: linear-gradient(135deg, #c05621 0%, #d97236 100%);
            border: 2px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 5px 15px rgba(192, 86, 33, 0.4);
        }

        .stat-card.alert-yellow:hover {
            box-shadow: 0 8px 25px rgba(192, 86, 33, 0.5);
        }

        @keyframes pulse-danger {
            0%, 100% {
                box-shadow: 0 5px 15px rgba(139, 0, 0, 0.5);
            }
            50% {
                box-shadow: 0 5px 25px rgba(139, 0, 0, 0.8);
            }
        }

        .stat-card h3 {
            font-size: 0.85em;
            margin-bottom: 10px;
            opacity: 0.9;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-card .value {
            font-size: 1.8em;
            font-weight: 700;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

        th, td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #e0e0e0;
        }

        th {
            background: linear-gradient(135deg, #383E42 0%, #4a5157 100%);
            color: white;
            font-weight: 600;
            position: sticky;
            top: 0;
            text-transform: uppercase;
            font-size: 0.85em;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #4A0010;
        }

        tr:hover {
            background: linear-gradient(90deg, rgba(74, 0, 16, 0.05) 0%, rgba(56, 62, 66, 0.05) 100%);
        }

        .table-container {
            max-height: 500px;
            overflow-y: auto;
            margin-top: 20px;
            border: 2px solid #383E42;
            border-radius: 5px;
            background: white;
        }

        .action-buttons {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .alert {
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            border-left: 4px solid;
        }

        .alert-success {
            background: #d4edda;
            color: #155724;
            border-left-color: #2d5016;
        }

        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border-left-color: #4A0010;
        }

        .alert-warning {
            background: #fff3cd;
            color: #856404;
            border-left-color: #c05621;
        }

        .alert-info {
            background: #d1ecf1;
            color: #0c5460;
            border-left-color: #383E42;
        }

        .delete-btn {
            background: #4A0010;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 0.85em;
            transition: all 0.3s;
        }

        .delete-btn:hover {
            background: #6b0017;
            transform: scale(1.05);
        }

        .loading {
            text-align: center;
            padding: 20px;
            color: #383E42;
        }

        .badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.85em;
            font-weight: 600;
        }

        .badge-aperto {
            background: #c05621;
            color: white;
        }

        .badge-chiuso {
            background: #2d5016;
            color: white;
        }

        .init-serbatoio-box {
            background: linear-gradient(135deg, rgba(192, 86, 33, 0.1) 0%, rgba(74, 0, 16, 0.1) 100%);
            border: 2px solid #c05621;
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            box-shadow: 0 4px 15px rgba(192, 86, 33, 0.2);
        }

        .init-serbatoio-box h3 {
            color: #4A0010;
            margin-bottom: 10px;
        }

        /* Tablet: 2 colonne */
        @media (max-width: 1024px) and (min-width: 769px) {
            .stats {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Mobile: 1 colonna */
        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }

            h1 {
                font-size: 1.5em;
            }

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

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